package com.huike.web.controller.contract;

import com.huike.business.domain.TbBusiness;
import com.huike.business.service.ITbBusinessService;
import com.huike.clues.domain.TbClue;
import com.huike.common.annotation.Log;
import com.huike.common.core.controller.BaseController;
import com.huike.common.core.domain.AjaxResult;
import com.huike.common.core.domain.entity.SysUser;
import com.huike.common.core.page.TableDataInfo;
import com.huike.common.enums.BusinessType;
import com.huike.contract.domain.vo.AssignmentDto;
import com.huike.contract.domain.vo.TransferVo;
import com.huike.contract.service.ITransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/transfer")
public class TransferController extends BaseController {

    @Autowired
    ITransferService transferService;

    @GetMapping("/list")
    public TableDataInfo selectTransferList(SysUser user){
        List<TransferVo> list = transferService.selectTransferVoList(user);
        return getDataTablePage(list);
    }

    @PutMapping("/assignment/{type}/{userId}/{transferUserId}")
    public AjaxResult assignment(@PathVariable int type,@PathVariable Long userId,@PathVariable Long transferUserId){
        AssignmentDto dto=new AssignmentDto(userId,transferUserId,type);
        transferService.assignment(dto);
        return AjaxResult.success(null);
    }

}